<%@ page language="java"
	import="java.util.*,edu.cnu.tpts.bean.*,edu.cnu.tpts.dao.*,edu.cnu.tpts.dao.impl.*"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/authorize.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



<html>
<head>
	<base href="<%=basePath%>">
    <title>admin</title>
    <link rel="stylesheet" type="text/css" href="/css/main.css">
    <script type="text/javascript">
	function testS(){
			var taskScore=document.getElementById("taskScore").value;
			var testScore=document.getElementById("testScore").value;
			
			if(parseInt(taskScore)+parseInt(testScore)>100){
				alert("总分之和不能大于100！");
				return false;
				}
			else{
			return true;
			}
				
		}
	
	</script>
</head>
<body>
<div id="header">

</div>

<div id="menu">
    <ul>

        
        <li><a hidefocus="hidefocus" href="teacher/showTeacher.jsp">查询个人信息</a></li>         
         <li><a hidefocus="hidefocus" href="teacher/updateTeacher.jsp">更新个人信息</a></li>
        <li><a hidefocus="hidefocus" href="teacher/showStudentScore.jsp">学生成绩维护</a></li>
        <li><a hidefocus="hidefocus" href="teacher/predict.jsp">成绩和能力预测</a></li>
        <li><a hidefocus="hidefocus" href="teacher/alarm.jsp">查看预警信息</a></li>
         <li><a hidefocus="hidefocus" href="quit.jsp">退出</a></li>
         	 <%@include file="/WEB-INF/date.jsp"%>
     </ul>
 
</div>

<div class="table">
   
    	<%
    	TeacherDaoImpl teacherDao=new TeacherDaoImpl();
    	
    	String stuIdStr=request.getParameter("stuId");
    	String couIdStr=request.getParameter("couId");
   		int stuId=0;
   		int couId=0;
   		//处理学号
   		if(null==stuIdStr||"".equals(stuIdStr)||"null".equals(stuIdStr)){
   		
   		}else{
   		stuId=Integer.parseInt(stuIdStr);
   		}
   		//处理课程号
   		if(null==couIdStr||"".equals(couIdStr)||"null".equals(couIdStr)){
   		
   		}else{
   		couId=Integer.parseInt(couIdStr);
   		}
		Student	student =teacherDao.findOneScore(stuId,couId);
		
    	 %>

   <form action="teacher/doUpdateStudentScore.jsp" method="post" onsubmit="return testS()">
   <table border="1px">
   <tr><td>学生编号</td> <td><input type="hidden" name="stuId" value="<%=student.getId() %>"><%=student.getId() %></td></tr>
   <tr><td>学生名称</td><td><%=student.getRealName() %></td></tr>
   <tr><td>性别</td><td><%=student.getSex() %></td></tr>
   <tr><td>所在院系</td><td><%=student.getStuDepartment() %></td></tr>
   <tr><td>所学课程</td><td><input type="hidden" name="couId" value="<%=student.getCouId() %>"><%=student.getCourseName() %></td></tr>
   <tr><td>平时测验成绩</td><td><input type="text" id="testScore" name="testScore" value="<%=student.getTestScore() %>"></td></tr>
   <tr><td>作业成绩</td><td><input id ="taskScore" type="text" name="taskScore" value="<%=student.getTaskScore() %>"></td></tr>
   <tr><td>总成绩</td><td><%=student.getTotalScore() %></td></tr>
   <tr><td colspan="2"  align="center"><input type="hidden" name="scoreId" value="<%=student.getScoreId() %>"><input type="submit" value="提交"></td></tr>
   </table>

  </form>
    	
</div>

<div id="copyright">
    <div align="center">
        <font face="Tahoma, Verdana" color="#ffffff">Copyright &copy; 首都师范大学版权所有<br>

            地址：北京市西三环北路105号 100048&nbsp;&nbsp;&nbsp;&nbsp; E-mail: </font><font face="Tahoma, Verdana">

    </font>
    </div>

</div>

</body>
</html>